package cn.dubito.learning.security.core.validator.code;

import java.awt.image.BufferedImage;
import java.time.LocalDateTime;

/**
 * @author liliang
 * @description:
 * @date 2018/2/1.
 */
public class ImageCode extends ValidateCode {

    /**
     * 图片验证码
     */
    private BufferedImage image;

    /**
     * @param image    背景图
     * @param code     验证码
     * @param expireIn 过期时间
     */
    public ImageCode(BufferedImage image, String code, int expireIn) {
        super(code, expireIn);
        this.image = image;
    }

    /**
     * 设置过期时间 构造
     *
     * @param code
     * @param expireTime
     * @param image
     */
    public ImageCode(String code, LocalDateTime expireTime, BufferedImage image) {
        super(code, expireTime);
        this.image = image;
    }

    public BufferedImage getImage() {
        return image;
    }

    public void setImage(BufferedImage image) {
        this.image = image;
    }

}
